﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="scheduler_schview_tree.aspx.cs" Inherits="Ccit.OA.Scheduler.scheduler_schview_tree" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%">
<head id="Head1" runat="server">
    <title>日程浏览</title>
    <link rel="Stylesheet" href="../css/main.css" type="text/css" />
     <script language="javascript" type="text/javascript" src="../script/jwindow.js"></script>
    <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
    <script language="javascript" src="../script/jquery.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
    <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="../script/jbase64.js"></script>
    <script  language="javascript">
        function doSeach(encodeParam)
        {
            parent.frames[1].location.href = "./scheduler_schview_list.aspx?"+encodeParam;      
        }
        
    </script>
    
     <script language="javascript" type="text/javascript">
            var tabPageArray = [];
            var tabTitleArray = [];
            
            function doChangeTab(tabSign){
                
                var curSelTabSign = document.getElementById("_hidSelTab").value;
                
                if(tabPageArray.length == 0) {
                    initTabPageArray();
                    initTabTitleArray();
                }
                
                document.getElementById("_hidSelTab").value = tabSign; 
                
                self.window.frames[0].document.location.href = findInfo(tabSign,tabPageArray);
            }
            
            function initTabPageArray() {
                var liItem;
               
                var organPageParam="pageFlag=1&TABID="+parent.frames.document.getElementById("hidTabID").value;;    //组织机构
                var organEncodeParam=base64encode(organPageParam);
                liItem = new ListItem("organ","./scheduler_organ_usersel.aspx?"+organEncodeParam);
                tabPageArray.push(liItem);
                
            }
            
            function initTabTitleArray() {
                var liItem;
                liItem = new ListItem("organ","组织机构");
                tabTitleArray.push(liItem);

            }
            
            function findInfo(tabSign,tabInfoArray) {
                var itemCount = tabInfoArray.length;
                var liItem;
                var retInfo = "";
                for(var i = 0; i < itemCount; i ++) {
                    liItem = tabInfoArray[i];
                    if(liItem.Text == tabSign) {
                        retInfo = liItem.Value;
                        break;
                    }
                }
                return retInfo;
            }
            /* 页签选中 */
            function setTabSelected(tabSign) {
                var leftImgId = "ast_left_" + tabSign;
                var rightImgId = "ast_right_" + tabSign;                
                var ctrlTab = document.getElementById(tabSign);
                var aId = "a" + tabSign;
                var aCtrl = document.getElementById(aId);
                
                document.getElementById(leftImgId).src = "../images/pagetab_h_left.gif";
                ctrlTab.background = "../images/pagetab_bg_high.gif";
                ctrlTab.className = "PageTabRangeSelect";                
                aCtrl.innerHTML = "<B>" + findInfo(tabSign,tabTitleArray) + "</B>";
                aCtrl.className = "linktext";
                document.getElementById(rightImgId).src = "../images/pagetab_h_right.gif";
            }


            /* 查询 */
            function doSearch()
            {
                var selTab = document.getElementById("_hidSelTab").value;
                var ddlCtrl = new DropDownList("ddlType");
                var ddlSel = ddlCtrl.selectedValue;
                var filter = document.getElementById("txtFilter").value;
                if(filter == "")
                {
                    alert("请输入要筛选的字符串");
                    return;
                }
                var selNodeId = window.frames[0].document.getElementById("_hidSelNodeId").value;
                var haveChild = window.frames[0].document.getElementById("_hidHaveChild").value;
                var nodeType = window.frames[0].document.getElementById("_hidNodeType").value;
                PageMethods.FindFilter(ddlSel,filter,selTab,selNodeId,haveChild,nodeType,ClientCallBack);
            }
            
            function ClientCallBack(vResult)
            {
                var vArray = vResult.split("_");
                var vType = vArray[0];
                switch(vType)
                {
                    case "filter" :
                       eval("var vObj = " + vArray[1]);
                       if(vObj.oFlag < 0)
                       {
                          alert(vObj.oFindName);
                       }
                       else if(vObj.oFlag > 0)
                       {
                          window.frames[0].document.getElementById("_hidFindId").value = vObj.oFindId;
                          window.frames[0].document.getElementById("_hidNodeType").value = vObj.oNodeType;
                          window.frames[0].document.all.btnTrigger.click();
                       }
                       else
                       {
                            alert("没有您要找的结果");
                       }
                       break;
                }
            }           
            
             function doChangeDate(pointer) {
                alert(pointer);
            }
            
    </script>
</head>
<body style="height:100%;width:99%">
    <ccit:ActionForm id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" />
     <asp:UpdatePanel ID="updatePanel" runat="server">    
        <ContentTemplate>
        <table cellpadding="0" cellspacing="0" width="100%" align="center" style="height:40%">
            <tr>
                <td align="center">
                    <asp:Calendar ID="Calendar1" runat="server" Width="192px" BackColor="White" 
                        BorderColor="#999999" Height="141px" CaptionAlign="Top" CellPadding="4" DayNameFormat="Shortest" 
                        Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" onselectionchanged="Calendar1_SelectionChanged">
                        <SelectedDayStyle BackColor="#9999FF" Font-Bold="True" ForeColor="White" />
                        <SelectorStyle BackColor="#CCCCCC" />
                        <WeekendDayStyle BackColor="#FFFFCC" />
                        <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                        <OtherMonthDayStyle ForeColor="Gray" />
                        <NextPrevStyle VerticalAlign="Bottom" />
                        <DayHeaderStyle BackColor="#FFFFCC" Font-Bold="True" Font-Size="7pt" />
                        <TitleStyle BackColor="#EEEAEB" BorderColor="Black" Font-Bold="True">
                         </TitleStyle>
                    </asp:Calendar>
                </td>
            </tr>
        </table>
<input type="hidden" id="_hidSelTab" runat="server" />
        <input type="hidden" id="lbDate" runat="server" />
        <input type="hidden" id="hidUserId" runat="server" />
        <input type="hidden" id="hidDeptId" runat="server" />
     <br />
        </ContentTemplate>
     </asp:UpdatePanel>        
     <table cellpadding="0" cellspacing="0"  border="0" width="192px" style="height:40%" align="center">
          <tr>
            <td align="center">
                <table cellpadding="0" cellspacing="0" align="left" width="192px">
                  <tr>
                    <td width='1px'><img src='../images/pagetab_h_left.gif'  id='ast_left_organ'></td>
                    <td width='80px' valign='middle' align='center' background='../images/pagetab_bg_high.gif' id="organ">
                        <nobr>&nbsp;<a id="aorgan" class="linktext" href="javascript:doChangeTab('organ')">组织结构</a>&nbsp;&nbsp;</nobr>
                    </td>
                    <td width='1px'><img src='../images/pagetab_h_right.gif'  id='ast_right_organ'></td>
                    
                    <td width="100%" background='./images/pagetab_bg.gif'>&nbsp;</td>             
                </tr>            
               </table>
            </td>
          </tr>
          <tr>		
            <td>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CECECE"	height="3">	
                    <tr>
                        <td width="100%">
                            <div id="toolbar_text"></div>
                        </td>
                    </tr>
                </table>
            </td>
           </tr> 
          <tr>
            <td valign="top" align="center"style="border-right:#CDCECF 1px solid;border-left:#CDCECF 1px solid;border-bottom:#CDCECF 1px solid;border-top:#D9D9DA 0px solid;height:100%">                    
                <iframe id="iFrmView" name="iFrmView" height="100%" src="" width="192px" scrolling="auto" frameborder="0" >
                </iframe>
            </td>
          </tr>
        </table>
    </ccit:ActionForm>
        <script type="text/javascript">
    <!--
        $(document).ready(function(){
        
            var curSelTabSign = document.getElementById("_hidSelTab").value;
           
            if(tabPageArray.length == 0) {
                initTabPageArray();
                initTabTitleArray();
            }
            
            // set new select tab style
            setTabSelected(curSelTabSign);
            
            if(curSelTabSign != "organ")
                setTabUnSel("organ");
            
            var strURL = findInfo(curSelTabSign,tabPageArray)  
            $get("iFrmView").src = strURL;
        });
        
    //-->
    </script>
</body>
</html>